import os,time,sys
import multiprocessing

def helloworld(name):
	print 'hello wporld', name, os.getpid()
	time.sleep(2)

def my_fork_pool_1():
	list_p = []
	for a in range(100):
		p = multiprocessing.Process(target=helloworld,args=[])
		list_p.append(p)

	for p in list_p:
		p.start()

	for p in list_p:
		p.join()

def my_fork_pool_2():
	p = multiprocessing.Pool(20)
	p.apply_async(helloworld, ['alex', ])
	p.map(helloworld, list('abcdefg'))

if __name__ == '__main__':
	my_fork_pool_2()